<div id="data_page" class="in_page">
	<div class="panel panel-default">
	  	<div class="panel-body">
		<a href="javascript:void(0)" class="btn btn-sm btn-primary " data-toggle="modal" data-target="#addnewModal" >添加</a>
		</div> 
	</div>
      <table class="table table-bordered">
        <thead>
          <tr>
           <!-- <th><span class="glyphicon glyphicon-gift"></span>#</th>-->
            <th><span class="glyphicon glyphicon-fire"></span>关键词</th>
         	<!--<th><span class="glyphicon glyphicon-fire"></span>状态</th>-->
            <th><span class="glyphicon glyphicon-calendar"></span>操作</th>
          </tr>
        </thead>
        <tbody>
      	<volist name="list" id="vo" >     
		  <tr>
         <!--   <th scope="row">{$vo.id}</th>-->
           
            <th>{$vo.title}</th>   
           <!--  <th>{$vo.status}</th>    -->
            <th>		
				 <a  href="{:U('Sc/delKey',array('id'=>$vo['id']))}" class="btn btn-danger btn-xs ldel">删除</a>  
  			</th>
          </tr> 
     	</volist>
        </tbody>
      </table> 
	  <nav><div class="pagelist">{$page}</div></nav>
<script>
</script>	
</div> 

<!-- Modal -->
<div class="modal fade" id="addnewModal" tabindex="-1" role="dialog" aria-labelledby="addnewModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="addnewModalLabel">添加关键词</h4>
      </div>
      <div class="modal-body">
      <form class="form-horizontal">
		  <div class="form-group">
		    <label for="inputKey" class="col-sm-2 control-label">关键词</label>
		    <div class="col-sm-10">
		      <input type="text" class="form-control" id="inputKey" name="inputKey" placeholder="请输入关键词">
		    </div>
		  </div>
		  </form>
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
        <button type="button" id="saveBtn" class="btn btn-primary">保存</button>
      </div>
    </div>
  </div>
</div>

<script language="javascript">
$(function(){
	$('#saveBtn').click(function(){
		var prm = {'title':$('#inputKey').val()};
		if(prm.title.length<1){ alert('请输入关键词！'); return false; }
		var url = '/admin.php/Sc/saveKey';
		$.post(url,prm,function(obj){
			alert(obj.m);
			if(obj.s) location.reload();
		});
	});
	
});
</script>